In [1]:
import numpy as np
import matplotlib.pyplot as plt

In [2]:
from scipy import stats
import speclines
import ebossspec, ebossanalysis

In [25]:
vac_objs = ebossspec.elg_readin(vac=True)
objs_ori = ebossspec.elg_readin()
nobj = objs_ori.size
galaxytype = objs_ori['CLASS']
zgood = objs_ori['zGOOD']
z = objs_ori['Z']
inuv = (np.where(np.logical_and(np.logical_and(np.logical_and(zgood, 
                                                   z>0.6), z<1.2), galaxytype=='GALAXY')))[0]

In [3]:
oiiewmin, oiiewmax, oiiewbin, oiilummin, oiilummax, oiilumbin = ebossspec.make_oiiewbins()

In [4]:
data = ebossanalysis.unify_emissionline_profile_readin()
emission_bstrap = ebossanalysis.unify_emissionline_profile_readin(bootstrap=True)
absorption = ebossanalysis.unify_absorptionline_profile_readin()
absorption_bstrap = ebossanalysis.unify_absorptionline_profile_readin(bootstrap=True)
corrected = ebossanalysis.corrected_velspace_flux_readin()
corrected_bstrap = ebossanalysis.corrected_velspace_flux_readin(bootstrap=True)
velmeasure = ebossanalysis.do_velocity_nonparametric()
velmeasure_bstrap = ebossanalysis.do_velocity_nonparametric(bootstrap=True)

In [5]:
rew_absorber = ebossanalysis.stack_absorber_readin(rew=True)
(ewvelflux, lumvelflux) = ebossanalysis.velspace_flux_readin(binoii=True)
(ewvelflux_bstrap, lumvelflux_bstrap) = ebossanalysis.velspace_flux_readin(binoii=True, bootstrap=True)
ew_emission, lum_emission = ebossanalysis.unify_emissionline_profile_readin(bootstrap=False, binoii=True)
ew_absorption, lum_absorption = ebossanalysis.unify_absorptionline_profile_readin(bootstrap=False, binoii=True)
(ew_corrected, lum_corrected) = ebossanalysis.corrected_velspace_flux_readin(binoii=True)
(ew_corrected_bstrap, lum_corrected_bstrap) = ebossanalysis.corrected_velspace_flux_readin(bootstrap=True, binoii=True)
(ew_velmeasure, lum_velmeasure) = ebossanalysis.do_velocity_nonparametric_binoii()
(ew_velmeasure_bstrap, lum_velmeasure_bstrap) = ebossanalysis.do_velocity_nonparametric_binoii(bootstrap=True)


This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.
This interpolation has some issues... Set to -9999.

In [6]:
emission_error = emission_bstrap['UNIFIEDDISP']
absorption_error = absorption_bstrap['UNIFIEDABSORPTION_DISP']
vpercent_lines_error = np.std(velmeasure_bstrap['FLUX_PERCENT'], axis=2)
vpercent_error = np.std(velmeasure_bstrap['UNIFIEDPERCENT'], axis=1)
tfabs_error = np.std(velmeasure_bstrap['TFABS'], axis=1)
ew_tfabs_error = np.std(ew_velmeasure_bstrap['TFABS'], axis=2)
em_fnorm_error = np.std(emission_bstrap['FNORM'], axis=1)

In [8]:
fig, axes = plt.subplots(figsize=(12,10), ncols=1, nrows=2)
axesall = axes.ravel()
fig.subplots_adjust(hspace=0, top=0.90, bottom=0.10)
xlimits = [-800,600]
ylimits = [0.9, 1.55]

#use_indices = data['INDEX']
use_indices = ([0,2,1,3])[::-1]
lines = data['LINES']
vel = data['VEL']
line_names = ['2366', '2396', '2613', '2626']
CM = plt.get_cmap('jet')
line_colors = [CM(fcolor) for fcolor in ((np.arange(4)+0.)/6.)]

for i, ax in enumerate(axesall):
    ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='x', which='minor', length=4, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='y', which='major', length=6, width=2, labelsize=20, pad=8)
    ax.tick_params(axis='y', which='minor', length=3, width=2, labelsize=20, pad=8)
    ax.set_xlim(xlimits) 
    ax.plot(xlimits, [1,1], ':', color='gray', lw=2)
    for axis in ['top','bottom','left','right']:
        ax.spines[axis].set_linewidth(2.2)

# Top panel:
ax = axesall[0]
for i,index in enumerate(use_indices):
    thisflux = ew_emission[1]['FLUX'][index]
    ax.plot(vel, thisflux, color=line_colors[i], lw=4)
    ax.text(-580, 1.45-i*0.05, line_names[index], color=line_colors[i], fontsize=24)
ax.text(-750, 1.45, r'Fe II*$\,\lambda$', color=line_colors[0], fontsize=24)
#ax.text(-750, 1.35, 'Fe II', color=line_colors[0], fontsize=22)
ax.plot([0,0], ylimits, ':', color='gray', lw=2)
plt.setp(ax.get_xticklabels(), visible=False)
#ax.xaxis.tick_top()
#ax.set_xlabel('Velocity (km/s)', fontsize=22)
#ax.set_ylabel('Flux (normalized)', fontsize=22)
ax.text(200, 1.4, 'High [O II] EW', fontsize=22, color='Black')
ax.set_ylim(ylimits)
ax.set_title('[OII] EW Dependence of Non-resonant Emission', fontsize=22)
    
# Middle panel
ax = axesall[1]
for i, index in enumerate(use_indices):
    thisflux = ew_emission[0]['FLUX'][index]
    ax.plot(vel, thisflux, color=line_colors[i], lw=4)
#ax.plot(vel, data['UNIFIEDFLUX'], color='black', lw=4)
ax.plot([0,0], ylimits, ':', color='gray', lw=2)
ax.text(-950, 1.34, r'Normalized flux $\left<R(\lambda)\right>$', fontsize=24, rotation='vertical', va='bottom')
ax.text(200, 1.4, 'Low [O II] EW', fontsize=22, color='Black')
ax.set_ylim(ylimits)
ax.set_xlabel(r'Velocity [km$\,$s$^{-1}$]', fontsize=24)

fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Emission_OII_EW.eps')



In [9]:
fig, axes = plt.subplots(figsize=(12,10), ncols=1, nrows=2)
axesall = axes.ravel()
fig.subplots_adjust(hspace=0, top=0.90, bottom=0.10)
xlimits = [-800,600]
ylimits = [0.9, 1.55]

#use_indices = data['INDEX']
use_indices = ([0,2,1,3])[::-1]
lines = data['LINES']
vel = data['VEL']
line_names = ['2366', '2396', '2613', '2626']
CM = plt.get_cmap('jet')
line_colors = [CM(fcolor) for fcolor in ((np.arange(4)+0.)/6.)]

for i, ax in enumerate(axesall):
    ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='x', which='minor', length=4, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='y', which='major', length=6, width=2, labelsize=20, pad=8)
    ax.tick_params(axis='y', which='minor', length=3, width=2, labelsize=20, pad=8)
    ax.set_xlim(xlimits) 
    ax.plot(xlimits, [1,1], ':', color='gray', lw=2)
    for axis in ['top','bottom','left','right']:
        ax.spines[axis].set_linewidth(2.2)

# Top panel:
ax = axesall[0]
for i,index in enumerate(use_indices):
    thisflux = lum_emission[1]['FLUX'][index]
    ax.plot(vel, thisflux, color=line_colors[i], lw=4)
    ax.text(-580, 1.45-i*0.05, line_names[index], color=line_colors[i], fontsize=24)
ax.text(-750, 1.45, r'Fe II*$\,\lambda$', color=line_colors[0], fontsize=24)
#ax.text(-750, 1.35, 'Fe II', color=line_colors[0], fontsize=22)
ax.plot([0,0], ylimits, ':', color='gray', lw=2)
plt.setp(ax.get_xticklabels(), visible=False)
#ax.xaxis.tick_top()
#ax.set_xlabel('Velocity (km/s)', fontsize=22)
#ax.set_ylabel('Flux (normalized)', fontsize=22)
ax.text(100, 1.4, 'High [O II] Luminosity', fontsize=22, color='Black')
ax.set_ylim(ylimits)
ax.set_title('[OII] Luminosity Dependence of Non-resonant Emission', fontsize=22)
    
# Middle panel
ax = axesall[1]
for i, index in enumerate(use_indices):
    thisflux = lum_emission[0]['FLUX'][index]
    ax.plot(vel, thisflux, color=line_colors[i], lw=4)
#ax.plot(vel, data['UNIFIEDFLUX'], color='black', lw=4)
ax.plot([0,0], ylimits, ':', color='gray', lw=2)
ax.text(-950, 1.34, r'Normalized flux $\left<R(\lambda)\right>$', fontsize=24, rotation='vertical', va='bottom')
ax.text(100, 1.4, 'Low [O II] Luminosity', fontsize=22, color='Black')
ax.set_ylim(ylimits)
ax.set_xlabel(r'Velocity [km$\,$s$^{-1}$]', fontsize=24)

fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Emission_OII_Lum.eps')



In [63]:
fig, axes = plt.subplots(figsize=(12,10), ncols=1, nrows=2)
axesall = axes.ravel()
fig.subplots_adjust(hspace=0, top=0.90, bottom=0.10)
xlimits = [-800,600]
ylimits = [-0.1, 1.15]
ylimits1 = [0.75, 1.075]

#use_indices = data['INDEX']
#use_indices = [3,5,6,4,7,0,2,1]
#use_indices = (np.array([5,3,6,4,7,0,2,1]))[::-1]
use_indices = (np.array([5, 6, 4, 7, 3, 0, 2, 1]))[::-1]
lines = absorption['LINES']
vel = absorption['VEL']
line_names = [str(int(np.rint(lines[index]))) for index in np.arange(8)]
species_names = ['FeII', 'MgII', 'MgII', 'MgI', 'FeII', 'FeII', 'FeII', 'FeII']
#line_names = ['2853', '2374', '2587', '2344', '2600', '2382', '2803', '2796']
#line_names = [2796', '2803', '2382', '2600', '2344', '2587', '2374', '2853']
#line_colors = ['blue', 'green', 'olive', 'magenta']

for i, ax in enumerate(axesall):
    ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='x', which='minor', length=4, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='y', which='major', length=6, width=2, labelsize=20, pad=8)
    ax.tick_params(axis='y', which='minor', length=3, width=2, labelsize=20, pad=8)
    ax.set_xlim(xlimits) 
    ax.plot(xlimits, [1,1], ':', color='gray', lw=2)
    for axis in ['top','bottom','left','right']:
        ax.spines[axis].set_linewidth(2.2)

# Top panel:
CM = plt.get_cmap('jet_r')
line_colors = [CM(fcolor) for fcolor in np.arange(8)/8.+1./8.][::-1]
ax = axesall[0]
for i, index in enumerate(use_indices):
    thisflux = ew_absorption[1]['FABS'][index]
    ax.plot(vel, thisflux, color=line_colors[i], lw=3)
    ax.text(-620, 0.70-i*0.10, line_names[index], color=line_colors[i], fontsize=22)
    ax.text(-720, 0.70-i*0.10, species_names[index], color=line_colors[i], fontsize=22)
ax.plot([0,0], ylimits, ':', color='gray', lw=2)


#ax.text(-750, 1.35, 'Fe II', color=line_colors[0], fontsize=22)
#ax.xaxis.tick_top()
#ax.set_xlabel('Velocity (km/s)', fontsize=22)
#ax.set_ylabel('Flux (normalized)', fontsize=22)
plt.setp(ax.get_xticklabels(), visible=False)
ax.text(200, 0.2, 'High [O II] EW', fontsize=22, color='Black')
ax.set_ylim(ylimits)
ax.set_title('[OII] EW Dependence of Absorption', fontsize=22)

    
# Middle panel
ax = axesall[1]
for i, index in enumerate(use_indices):
    thisflux = ew_absorption[0]['FABS'][index]
    ax.plot(vel, thisflux, color=line_colors[i], lw=3)
#ax.plot(vel, data['UNIFIEDFLUX'], color='black', lw=4)
ax.plot([0,0], ylimits, ':', color='gray', lw=2)
ax.text(-950, 0.75, r'Normalized flux $\left<R(\lambda)\right>$', fontsize=24, rotation='vertical', va='bottom')
ax.text(200, 0.2, 'Low [O II] EW', fontsize=22, color='Black')
ax.set_ylim(ylimits)
ax.set_xlabel(r'Velocity [km$\,$s$^{-1}$]', fontsize=24)

fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Absorption_Profile_Emission_Corrected_EW.eps')



In [64]:
fig, axes = plt.subplots(figsize=(12,10), ncols=1, nrows=2)
axesall = axes.ravel()
fig.subplots_adjust(hspace=0, top=0.90, bottom=0.10)
xlimits = [-800,600]
ylimits = [-0.1, 1.15]
ylimits1 = [0.75, 1.075]

#use_indices = data['INDEX']
#use_indices = [3,5,6,4,7,0,2,1]
#use_indices = (np.array([5,3,6,4,7,0,2,1]))[::-1]
use_indices = (np.array([5, 6, 4, 7, 3, 0, 2, 1]))[::-1]
lines = absorption['LINES']
vel = absorption['VEL']
line_names = [str(int(np.rint(lines[index]))) for index in np.arange(8)]
species_names = ['FeII', 'MgII', 'MgII', 'MgI', 'FeII', 'FeII', 'FeII', 'FeII']
#line_names = ['2853', '2374', '2587', '2344', '2600', '2382', '2803', '2796']
#line_names = [2796', '2803', '2382', '2600', '2344', '2587', '2374', '2853']
#line_colors = ['blue', 'green', 'olive', 'magenta']

for i, ax in enumerate(axesall):
    ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='x', which='minor', length=4, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='y', which='major', length=6, width=2, labelsize=20, pad=8)
    ax.tick_params(axis='y', which='minor', length=3, width=2, labelsize=20, pad=8)
    ax.set_xlim(xlimits) 
    ax.plot(xlimits, [1,1], ':', color='gray', lw=2)
    for axis in ['top','bottom','left','right']:
        ax.spines[axis].set_linewidth(2.2)

# Top panel:
CM = plt.get_cmap('jet_r')
line_colors = [CM(fcolor) for fcolor in np.arange(8)/8.+1./8.][::-1]
ax = axesall[0]
for i, index in enumerate(use_indices):
    thisflux = lum_absorption[1]['FABS'][index]
    ax.plot(vel, thisflux, color=line_colors[i], lw=3)
    ax.text(-620, 0.70-i*0.10, line_names[index], color=line_colors[i], fontsize=22)
    ax.text(-720, 0.70-i*0.10, species_names[index], color=line_colors[i], fontsize=22)
ax.plot([0,0], ylimits, ':', color='gray', lw=2)


#ax.text(-750, 1.35, 'Fe II', color=line_colors[0], fontsize=22)
#ax.xaxis.tick_top()
#ax.set_xlabel('Velocity (km/s)', fontsize=22)
#ax.set_ylabel('Flux (normalized)', fontsize=22)
plt.setp(ax.get_xticklabels(), visible=False)
ax.text(130, 0.18, 'High [O II] Luminosity', fontsize=22, color='Black')
ax.set_ylim(ylimits)
ax.set_title('[OII] Luminosity Dependence of Absorption', fontsize=22)
    
# Middle panel
ax = axesall[1]
for i, index in enumerate(use_indices):
    thisflux = lum_absorption[0]['FABS'][index]
    ax.plot(vel, thisflux, color=line_colors[i], lw=3)
#ax.plot(vel, data['UNIFIEDFLUX'], color='black', lw=4)
ax.plot([0,0], ylimits, ':', color='gray', lw=2)
ax.text(-950, 0.75, r'Normalized flux $\left<R(\lambda)\right>$', fontsize=24, rotation='vertical', va='bottom')
ax.text(130, 0.18, 'Low [O II] Luminosity', fontsize=22, color='Black')
ax.set_ylim(ylimits)
ax.set_xlabel(r'Velocity [km$\,$s$^{-1}$]', fontsize=24)

fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Absorption_Profile_Emission_Corrected_Lum.eps')



In [61]:
fig, axes = plt.subplots(figsize=(10,9), ncols=1, nrows=2)
axesall = axes.ravel()
fig.subplots_adjust(hspace=0, top=0.90, bottom=0.10)
xlimits = [-800,600]
ylimits = [-0.1, 1.15]
ylimits1 = [0.75, 1.075]

#use_indices = data['INDEX']
use_indices = [3,5,6,4,7,0,2,1]
lines = absorption['LINES']
vel = absorption['VEL']
line_names = [str(int(np.rint(lines[index]))) for index in np.arange(8)]
species_names = ['FeII', 'MgII', 'MgII', 'MgI', 'FeII', 'FeII', 'FeII', 'FeII']

#line_names = ['2853', '2374', '2587', '2344', '2600', '2382', '2803', '2796']
#line_names = [2796', '2803', '2382', '2600', '2344', '2587', '2374', '2853']
#line_colors = ['blue', 'green', 'olive', 'magenta']

for i, ax in enumerate(axesall):
    ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='x', which='minor', length=4, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='y', which='major', length=6, width=2, labelsize=20, pad=8)
    ax.tick_params(axis='y', which='minor', length=3, width=2, labelsize=20, pad=8)
    ax.set_xlim(xlimits) 
    ax.plot(xlimits, [1,1], ':', color='gray', lw=2)
    for axis in ['top','bottom','left','right']:
        ax.spines[axis].set_linewidth(2.2)

yerr = np.median(absorption_error[80:120])*np.sqrt(2)

# Top panel:
#CM = get_cmap('gist_heat')
#line_colors = [CM(fcolor) for fcolor in arange(8)/8./1.5+0.1]
ax = axesall[0]
ax.plot(vel, ew_absorption[1]['UNIFIEDABSORPTION'], lw=3, color='Blue')
ax.plot(vel, ew_absorption[0]['UNIFIEDABSORPTION'], '--', lw=3, color='Magenta')
ax.plot([0,0], ylimits1, ':', color='gray', lw=2)
ax.errorbar([-700],[0.85],yerr=yerr,fmt='o',ms=10,lw=3,capsize=5,capthick=2)

#ax.text(-750, 1.35, 'Fe II', color=line_colors[0], fontsize=22)
#ax.xaxis.tick_top()
#ax.set_xlabel('Velocity (km/s)', fontsize=22)
#ax.set_ylabel('Flux (normalized)', fontsize=22)
plt.setp(ax.get_xticklabels(), visible=False)
ax.text(180, 0.83, 'High [O II] EW', fontsize=21, color='Blue')
ax.text(180, 0.80, 'Low [O II] EW', fontsize=21, color='Magenta')
ax.set_ylim(ylimits1)
ax.set_title('Unified Absorption Profile', fontsize=22)

    
# Middle panel
ax = axesall[1]
ax.plot(vel, lum_absorption[1]['UNIFIEDABSORPTION'], lw=3, color='Navy')
ax.plot(vel, lum_absorption[0]['UNIFIEDABSORPTION'], '--', lw=3, color='Red')
ax.plot([0,0], ylimits1, ':', color='gray', lw=2)
ax.text(100, 0.83, 'High [O II] Luminosity', fontsize=20, color='Navy')
ax.text(100, 0.80, 'Low [O II] Luminosity', fontsize=20, color='Red')


#ax.plot(vel, data['UNIFIEDFLUX'], color='black', lw=4)
ax.text(-975, 0.915, r'Normalized flux $\left<R(\lambda)\right>$', fontsize=24, rotation='vertical', va='bottom')
ax.errorbar([-700],[0.85],yerr=yerr,fmt='o',ms=10,lw=3,capsize=5,capthick=2)
#ax.text(130, 0.18, 'Low [O II] Luminosity', fontsize=22, color='Black')
ax.set_ylim(ylimits1)
ax.set_xlabel(r'Velocity [km$\,$s$^{-1}$]', fontsize=24)

fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Unified_Absorption_Profile_EW.eps')



In [62]:
fig, axes = plt.subplots(figsize=(10,9), ncols=1, nrows=2)
axesall = axes.ravel()
fig.subplots_adjust(hspace=0, top=0.90, bottom=0.10)
xlimits = [-800,600]
ylimits = [-0.1, 1.15]
ylimits1 = [0.9, 1.35]

#use_indices = data['INDEX']
use_indices = [3,5,6,4,7,0,2,1]
lines = absorption['LINES']
vel = absorption['VEL']
line_names = [str(int(np.rint(lines[index]))) for index in np.arange(8)]
#line_names = ['2853', '2374', '2587', '2344', '2600', '2382', '2803', '2796']
#line_names = [2796', '2803', '2382', '2600', '2344', '2587', '2374', '2853']
#line_colors = ['blue', 'green', 'olive', 'magenta']

for i, ax in enumerate(axesall):
    ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='x', which='minor', length=4, width=2, labelsize=22, pad=8)
    ax.tick_params(axis='y', which='major', length=6, width=2, labelsize=20, pad=8)
    ax.tick_params(axis='y', which='minor', length=3, width=2, labelsize=20, pad=8)
    ax.set_xlim(xlimits) 
    ax.plot(xlimits, [1,1], ':', color='gray', lw=2)
    for axis in ['top','bottom','left','right']:
        ax.spines[axis].set_linewidth(2.2)

yerr = np.median(emission_error[80:120])*np.sqrt(2)

# Top panel:
#CM = get_cmap('gist_heat')
#line_colors = [CM(fcolor) for fcolor in arange(8)/8./1.5+0.1]
ax = axesall[0]
ax.plot(vel, ew_emission[1]['UNIFIEDFLUX'], lw=3, color='Blue')
ax.plot(vel, ew_emission[0]['UNIFIEDFLUX'], '--', lw=3, color='Magenta')
ax.plot([0,0], ylimits1, ':', color='gray', lw=2)
ax.errorbar([-700],[1.25],yerr=yerr,fmt='o',ms=10,lw=3,capsize=5,capthick=2)

#ax.text(-750, 1.35, 'Fe II', color=line_colors[0], fontsize=22)
#ax.xaxis.tick_top()
#ax.set_xlabel('Velocity (km/s)', fontsize=22)
#ax.set_ylabel('Flux (normalized)', fontsize=22)
plt.setp(ax.get_xticklabels(), visible=False)
ax.text(180, 1.24, 'High [O II] EW', fontsize=21, color='Blue')
ax.text(180, 1.20, 'Low [O II] EW', fontsize=21, color='Magenta')
ax.set_ylim(ylimits1)
ax.set_title('Unified Emission Profile', fontsize=22)
    
# Middle panel
ax = axesall[1]
ax.plot(vel, lum_emission[1]['UNIFIEDFLUX'], lw=3, color='Navy')
ax.plot(vel, lum_emission[0]['UNIFIEDFLUX'], '--', lw=3, color='Red')
ax.plot([0,0], ylimits1, ':', color='gray', lw=2)
ax.text(100, 1.24, 'High [O II] Luminosity', fontsize=20, color='Navy')
ax.text(100, 1.20, 'Low [O II] Luminosity', fontsize=20, color='Red')


#ax.plot(vel, data['UNIFIEDFLUX'], color='black', lw=4)
ax.text(-975, 1.175, r'Normalized flux $\left<R(\lambda)\right>$', fontsize=24, rotation='vertical', va='bottom')
ax.errorbar([-700],[1.25],yerr=yerr,fmt='o',ms=10,lw=3,capsize=5,capthick=2)
#ax.text(130, 0.18, 'Low [O II] Luminosity', fontsize=22, color='Black')
ax.set_ylim(ylimits1)
ax.set_xlabel(r'Velocity [km$\,$s$^{-1}$]', fontsize=24)

fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Unified_Emission_Profile_EW.eps')



In [60]:
composite0 = ebossspec.feiimgii_composite_readin(bootstrap=False, binoii=True)

In [61]:
composite0.dtype


Out[61]:
dtype([('WAVE', '>f4', (2651,)), ('EWFLUXMEDIAN', '>f4', (2651, 14)), ('EWOII_FLUXMEDIAN', '>f4', (2651, 14)), ('LUMFLUXMEDIAN', '>f4', (2651, 14)), ('LUMOII_FLUXMEDIAN', '>f4', (2651, 14)), ('OIIEWMIN', '>f4', (14,)), ('OIIEWMAX', '>f4', (14,)), ('OIIEWBIN', '>f4', (14,)), ('OIILUMMIN', '>f4', (14,)), ('OIILUMMAX', '>f4', (14,)), ('OIILUMBIN', '>f4', (14,))])

In [68]:
thiscomposite = np.array([(composite0['WAVE'], composite0['EWFLUXMEDIAN'])], \
                          dtype=[('WAVE', 'f4', composite0['WAVE'].shape), ('FLUXMEDIAN', 'f4', composite0['EWFLUXMEDIAN'].shape)])

In [69]:
thiscomposite.dtype


Out[69]:
dtype([('WAVE', '<f4', (2651,)), ('FLUXMEDIAN', '<f4', (2651, 14))])

In [70]:
composite0_bstrap = ebossspec.feiimgii_composite_readin(bootstrap=True, binoii=True)

In [71]:
composite0_bstrap.dtype


Out[71]:
dtype([('WAVE', '>f4', (2651,)), ('EWFLUXMEDIAN', '>f4', (2651, 100, 14)), ('EWOII_FLUXMEDIAN', '>f4', (2651, 100, 14)), ('LUMFLUXMEDIAN', '>f4', (2651, 100, 14)), ('LUMOII_FLUXMEDIAN', '>f4', (2651, 100, 14)), ('OIIEWMIN', '>f4', (14,)), ('OIIEWMAX', '>f4', (14,)), ('OIIEWBIN', '>f4', (14,)), ('OIILUMMIN', '>f4', (14,)), ('OIILUMMAX', '>f4', (14,)), ('OIILUMBIN', '>f4', (14,))])

In [78]:
ew_velmeasure.dtype


Out[78]:
dtype([('LINES', '<f8', (8,)), ('PERCENT', '<f8', (17,)), ('FLUX_PERCENT', '<f8', (17, 8)), ('FABS_PERCENT', '<f8', (17, 8)), ('UNIFIEDPERCENT', '<f8', (17,)), ('TFLUX', '<f8', (8,)), ('TFABS', '<f8', (8,))])

In [103]:
lines = ew_velmeasure[0]['LINES']

In [85]:
print ew_velmeasure[2]['TFLUX']
print ew_velmeasure[4]['TFLUX']


[ 1.40714887  2.56217911  2.65368083  0.92242533  1.63108842  1.20503842
  1.53088393  1.81614286]
[ 1.3234585   1.16754116  1.41852932  0.59947526  1.89461226  1.35495726
  2.09197909  2.37914665]

In [86]:
print ew_velmeasure[2]['TFABS']
print ew_velmeasure[4]['TFABS']


[ 1.90953499  4.38553263  4.85391323  1.43842411  2.12962636  1.20507552
  1.53088392  2.02123405]
[ 2.62533709  3.76521094  4.26469232  1.47363495  2.63425649  1.35499514
  2.50445373  3.54263179]

In [100]:
print ew_velmeasure[2]['FLUX_PERCENT'][8,:]
print ew_velmeasure[2]['FABS_PERCENT'][8,:]
print ew_velmeasure[2]['UNIFIEDPERCENT'][14]
print ew_velmeasure[4]['UNIFIEDPERCENT'][14]


[ -53.71748204 -111.18851307 -141.22942253  -67.62469513  -61.20091728
  -24.48236859  -31.89615076  -60.8828562 ]
[-32.03255083 -49.38108618 -95.10097693 -36.60884604 -40.60796902
 -24.47548787 -31.89615113 -52.57567022]
-195.927243388
-160.705024261

In [67]:
fig, ax = plt.subplots(figsize=(9,9), ncols=1, nrows=1)

#use_indices = ([5,3,6,4,7,0,2,1])[::-1]
use_indices = (np.array([5, 6, 4, 7, 3, 0, 2, 1]))[::-1]
lines = absorption['LINES']
line_names = [str(int(np.rint(lines[index]))) for index in np.arange(8)]
species_names = ['FeII', 'MgII', 'MgII', 'MgI', 'FeII', 'FeII', 'FeII', 'FeII']

CM = plt.get_cmap('jet_r')
line_colors = [CM(fcolor) for fcolor in np.arange(8)/8.+1./8.][::-1]
x0 = np.array([oiiewbin[0], 51., oiiewbin[1]])
for i, index in enumerate(use_indices):
    #plot(oiiewbin[2:5], ew_velmeasure['TFABS'][2:5, i], 'o-')
    yerr = np.array([ew_tfabs_error[0,index], tfabs_error[index], ew_tfabs_error[1,index]])
    y = np.array([ew_velmeasure['TFABS'][0,index], velmeasure['TFABS'][index], ew_velmeasure['TFABS'][1,index]])
    x = x0*np.power(1.005,i)
    ax.plot(x, y, 'o', ms=12, color=line_colors[i], mfc='None', mec=line_colors[i], mew=2)
    ax.plot(x[1], y[1], 'o', ms=12, color=line_colors[i])    
    ax.errorbar(x, y, yerr, color=line_colors[i], ms=15, capsize=4, capthick=2)
    #plot(oiiewbin[0:2], lum_velmeasure['TFABS'][0:2, i], 'o-')
    #text(87, 4*np.power(0.9, i), line_names[index], color=line_colors[i], fontsize=24)
    if (index == 6):
        ax.text(95.5, ew_velmeasure['TFABS'][1, index]*1.07, line_names[index], color=line_colors[i], fontsize=21)
        ax.text(84, ew_velmeasure['TFABS'][1, index]*1.07, species_names[index], color=line_colors[i], fontsize=21)
    elif (index == 1):
        ax.text(95.5, ew_velmeasure['TFABS'][1, index]*1.08, line_names[index], color=line_colors[i], fontsize=21)
        ax.text(84, ew_velmeasure['TFABS'][1, index]*1.08, species_names[index], color=line_colors[i], fontsize=21)
    else:
        ax.text(95.5, ew_velmeasure['TFABS'][1, index]*1.00, line_names[index], color=line_colors[i], fontsize=21)
        ax.text(84, ew_velmeasure['TFABS'][1, index]*1.00, species_names[index], color=line_colors[i], fontsize=21)


        
ax.set_xlim(30,115)
ax.set_ylim(0.9, 6.5)
ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=20, pad=8)
ax.tick_params(axis='y', which='major', length=8, width=2, labelsize=20, pad=8)
ax.set_xscale('log')
ax.set_yscale('log')
xtickpos = [30, 40, 50, 60, 70, 80, 90, 100]
xticknames = ['30', '40', '50', '60', '70', '80', '90', '100']
ax.set_xticks(xtickpos)
ax.set_xticklabels(xticknames, rotation=0, fontsize=20)
ytickpos = [1., 2., 3., 4., 5., 6.]
yticknames = ['1.0', '2.0', '3.0', '4.0', '5.0', '6.0']
ax.set_yticks(ytickpos)
ax.set_yticklabels(yticknames, fontsize=20)
ax.set_xlabel(r'$W_{\rm O\,II}^{\lambda3728}$ [$\rm \AA$]', fontsize=22)
ax.set_ylabel(r'Absorption EW [$\rm \AA$]', fontsize=22)
ax.set_title('[OII] EW Dependence of Absorption', fontsize=22)

fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Absorption_Strength_EW.eps')



In [70]:
fig, ax = plt.subplots(figsize=(9,9), ncols=1, nrows=1)

#use_indices = ([5,3,6,4,7,0,2,1])[::-1]
use_indices = (np.array([5, 6, 4, 7, 3, 0, 2, 1]))[::-1]
lines = absorption['LINES']
line_names = [str(int(np.rint(lines[index]))) for index in np.arange(8)]
species_names = ['FeII', 'MgII', 'MgII', 'MgI', 'FeII', 'FeII', 'FeII', 'FeII']

CM = plt.get_cmap('jet_r')
line_colors = [CM(fcolor) for fcolor in np.arange(8)/8.+1./8.][::-1]

x0 = np.array([oiilumbin[0], 41.62, oiilumbin[1]])
for i, index in enumerate(use_indices):
    #plot(oiiewbin[2:5], ew_velmeasure['TFABS'][2:5, i], 'o-')
    yerr = np.array([ew_tfabs_error[0,index], tfabs_error[index], ew_tfabs_error[1,index]])
    y = np.array([lum_velmeasure['TFABS'][0,index], velmeasure['TFABS'][index], lum_velmeasure['TFABS'][1,index]])
    x = x0+0.003*i
    ax.plot(x, y, 'o', ms=12, color=line_colors[i], mfc='None', mec=line_colors[i], mew=2)
    ax.plot(x[1], y[1], 'o', ms=12, color=line_colors[i])
    ax.errorbar(x, y, yerr, color=line_colors[i], ms=15, capsize=4, capthick=2)
    #plot(oiiewbin[0:2], lum_velmeasure['TFABS'][0:2, i], 'o-')
    #text(87, 4*np.power(0.9, i), line_names[index], color=line_colors[i], fontsize=24)
    if (index == 4):
        ax.text(42.02, lum_velmeasure['TFABS'][1, index]*0.93, line_names[index], color=line_colors[i], fontsize=22)
        ax.text(41.935, lum_velmeasure['TFABS'][1, index]*0.93, species_names[index], color=line_colors[i], fontsize=22)
    elif (index == 1):
        ax.text(42.02, lum_velmeasure['TFABS'][1, index]*1.05, line_names[index], color=line_colors[i], fontsize=22)
        ax.text(41.935, lum_velmeasure['TFABS'][1, index]*1.05, species_names[index], color=line_colors[i], fontsize=22)
    elif (index == 0):
        ax.text(42.02, lum_velmeasure['TFABS'][1, index]*1.05, line_names[index], color=line_colors[i], fontsize=22)
        ax.text(41.935, lum_velmeasure['TFABS'][1, index]*1.05, species_names[index], color=line_colors[i], fontsize=22)    
    else:
        ax.text(42.02, lum_velmeasure['TFABS'][1, index]*1.00, line_names[index], color=line_colors[i], fontsize=22)
        ax.text(41.935, lum_velmeasure['TFABS'][1, index]*1.00, species_names[index], color=line_colors[i], fontsize=22)

ax.set_xlim(41.27,42.15)
ax.set_ylim(0.9, 6.5)
ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=20, pad=8)
ax.tick_params(axis='y', which='major', length=8, width=2, labelsize=20, pad=8)
#xscale('log')
ax.set_yscale('log')
#xtickpos = [30, 40, 50, 60, 70, 80, 90, 100]
#xticknames = ['30', '40', '50', '60', '70', '80', '90', '100']
#xticks(xtickpos, xticknames, rotation=0, fontsize=20)
ytickpos = [1., 2., 3., 4., 5., 6.]
yticknames = ['1.0', '2.0', '3.0', '4.0', '5.0', '6.0']
ax.set_yticks(ytickpos)
ax.set_yticklabels(yticknames, fontsize=20)
ax.set_xlabel(r'$\log_{10}\,L_{\rm O\,II}^{\lambda3728}$ [${\rm erg\,s}^{-1}$]', fontsize=22)
ax.set_ylabel(r'Absorption EW [$\rm \AA$]', fontsize=22)
ax.set_title('[OII] Luminosity Dependence of Absorption', fontsize=22)

fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Absorption_Strength_Lum.eps')



In [68]:
fig, ax = plt.subplots(figsize=(9,9), ncols=1, nrows=1)

use_indices = ([0,2,1,3])[::-1]
lines = data['LINES']
vel = data['VEL']
line_names = ['2366', '2396', '2613', '2626']
CM = plt.get_cmap('jet')
line_colors = [CM(fcolor) for fcolor in ((np.arange(4)+0.)/6.)]

x0 = np.array([oiiewbin[0], 51., oiiewbin[1]])
for i, index in enumerate(use_indices):
    #plot(oiiewbin[2:5], ew_velmeasure['TFABS'][2:5, i], 'o-')
    #yerr = array([ew_tfabs_error[0,index], tfabs_error[index], ew_tfabs_error[1,index]])
    yerr = np.array([em_fnorm_error[index]*np.sqrt(2.), em_fnorm_error[index], em_fnorm_error[index]*np.sqrt(2.)])
    y = np.array([ew_emission['FNORM'][0,index], data['FNORM'][index], ew_emission['FNORM'][1,index]])
    dwave = 1E-4*np.log(10)*lines[index]
    x = x0*np.power(1.005,i)
    ax.plot(x, y*dwave, 'o', ms=12, color=line_colors[i], mfc='None', mec=line_colors[i], mew=2)
    ax.plot(x[1], y[1]*dwave, 'o', ms=12, color=line_colors[i])
    ax.errorbar(x, y*dwave, yerr*dwave, color=line_colors[i], ms=15, capsize=4, capthick=2)
    #plot(oiiewbin[0:2], lum_velmeasure['TFABS'][0:2, i], 'o-')
    #text(87, 4*np.power(0.9, i), line_names[index], color=line_colors[i], fontsize=24)
    ax.text(84, y[2]*dwave*0.98, line_names[index], color=line_colors[i], fontsize=22)
    
ax.text(84, 1.3, 'Fe II*', color=line_colors[0], fontsize=22)        
ax.set_xlim(30,115)
ax.set_ylim(0.18, 1.8)
ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=20, pad=8)
ax.tick_params(axis='y', which='major', length=8, width=2, labelsize=20, pad=8)
ax.set_xscale('log')
ax.set_yscale('log')
xtickpos = [30, 40, 50, 60, 70, 80, 90, 100]
xticknames = ['30', '40', '50', '60', '70', '80', '90', '100']
ax.set_xticks(xtickpos)
ax.set_xticklabels(xticknames, rotation=0, fontsize=20)
ytickpos = [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
yticknames = ['0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1.0']
ax.set_yticks(ytickpos)
ax.set_yticklabels(yticknames, fontsize=20)
ax.set_xlabel(r'$W_{\rm O\,II}^{\lambda3728}$ [$\rm \AA$]', fontsize=22)
ax.set_ylabel(r'Emission EW [$\rm \AA$]', fontsize=22)
ax.set_title('[OII] EW Dependence of Non-resonant Emission', fontsize=22)

fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Emission_Strength_EW.eps')



In [71]:
fig, ax = plt.subplots(figsize=(9,9), ncols=1, nrows=1)

use_indices = ([0,2,1,3])[::-1]
lines = data['LINES']
vel = data['VEL']
line_names = ['2366', '2396', '2613', '2626']
CM = plt.get_cmap('jet')
line_colors = [CM(fcolor) for fcolor in ((np.arange(4)+0.)/6.)]

x0 = np.array([oiilumbin[0], 41.62, oiilumbin[1]])
for i, index in enumerate(use_indices):
    #plot(oiiewbin[2:5], ew_velmeasure['TFABS'][2:5, i], 'o-')
    #yerr = array([ew_tfabs_error[0,index], tfabs_error[index], ew_tfabs_error[1,index]])
    yerr = np.array([em_fnorm_error[index]*np.sqrt(2.), em_fnorm_error[index], em_fnorm_error[index]*np.sqrt(2.)])
    y = np.array([lum_emission['FNORM'][0,index], data['FNORM'][index], lum_emission['FNORM'][1,index]])
    dwave = 1E-4*np.log(10)*lines[index]
    x = x0#*power(1.005,i)
    ax.plot(x, y*dwave, 'o', ms=12, color=line_colors[i], mfc='None', mec=line_colors[i], mew=2)
    ax.plot(x[1], y[1]*dwave, 'o', ms=12, color=line_colors[i])
    ax.errorbar(x, y*dwave, yerr*dwave, color=line_colors[i], ms=15, capsize=4, capthick=2)
    #plot(oiiewbin[0:2], lum_velmeasure['TFABS'][0:2, i], 'o-')
    #text(87, 4*np.power(0.9, i), line_names[index], color=line_colors[i], fontsize=24)
    ax.text(41.935, y[2]*dwave*0.98, line_names[index], color=line_colors[i], fontsize=22)
    
ax.text(41.935, 1.05, 'Fe II*', color=line_colors[0], fontsize=22)             
ax.set_xlim(41.27,42.15)
ax.set_ylim(0.18, 1.8)
ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=20)
ax.tick_params(axis='y', which='major', length=8, width=2, labelsize=20)
#xscale('log')
ax.set_yscale('log')
#xtickpos = [30, 40, 50, 60, 70, 80, 90, 100]
#xticknames = ['30', '40', '50', '60', '70', '80', '90', '100']
#xticks(xtickpos, xticknames, rotation=0, fontsize=20)
ytickpos = [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
yticknames = ['0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1.0']
ax.set_yticks(ytickpos)
ax.set_yticklabels(yticknames, fontsize=20)
ax.set_xlabel(r'$\log_{10}\,L_{\rm O\,II}^{\lambda3728}$ [${\rm erg\,s}^{-1}$]', fontsize=22)
ax.set_ylabel(r'Emission EW [$\rm \AA$]', fontsize=22)
ax.set_title('[OII] Luminosity Dependence of Non-resonant Emission', fontsize=22)

fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Emission_Strength_Lum.eps')



In [171]:
absorption['FABS'].shape


Out[171]:
(8, 200)

In [168]:
ew_absorption.dtype


Out[168]:
dtype([('LINES', '>f8', (8,)), ('VEL', '>f8', (200,)), ('FLUX', '>f8', (8, 200)), ('FABS', '>f8', (8, 200)), ('NORMFABS', '>f8', (8, 200)), ('FNORM', '>f8', (8,)), ('INDEX', '>i4', (8,)), ('UNIFIEDABSORPTION', '>f8', (200,)), ('UNIFIEDABSORPTION_DISP', '>f8', (200,)), ('UNIFIEDEMISSION', '>f8', (200,)), ('UNIFIEDEMISSION_DISP', '>f8', (200,)), ('COEFF', '>f8', (8, 2)), ('FABS_2374', '>f8', (200,))])

In [183]:
figsize(12,6)
plot(vel, absorption['FABS'][0,:])
plot(vel, absorption['FLUX'][0,:])
#plot(vel, absorption['FLUX'][7,:])
#plot(vel, absorption['FABS'][7,:])


Out[183]:
[<matplotlib.lines.Line2D at 0x135b3a750>]

In [227]:
lum_velmeasure['TFABS'][0]


Out[227]:
array([ 1.67060843,  4.02084236,  4.56946196,  1.19419169,  1.77066439,
        1.11745203,  1.54654193,  2.3428542 ])

In [228]:
lum_velmeasure['TFABS'][1]


Out[228]:
array([ 2.36793121,  4.07707515,  4.36794159,  1.53139381,  2.27102304,
        1.3368762 ,  2.25245309,  3.09683242])

In [246]:
ew_absorption[0]['LINES']


Out[246]:
array([ 2382.764,  2796.352,  2803.531,  2852.964,  2344.213,  2374.46 ,
        2586.649,  2600.172])

In [284]:
plot(vel, ew_absorption[1]['UNIFIEDABSORPTION'])
xlim(-800, 600)


Out[284]:
(-800, 600)

In [22]:
vac_objs.dtype


Out[22]:
dtype([('Z', '>f4', (21528,)), ('OIILUM', '>f8', (21528,)), ('OIIEW', '>f8', (21528,))])

In [69]:
fig = plt.figure(figsize=(9,7))
ax = fig.add_subplot(111)
n, bins, patches = ax.hist(vac_objs['OIIEW'][inuv], 
                           bins=np.arange(0, 200, 5), edgecolor='black')
ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=22, pad=8)
ax.tick_params(axis='x', which='minor', length=4, width=2, labelsize=22, pad=8)
ax.tick_params(axis='y', which='major', length=6, width=2, labelsize=20, pad=8)
ax.tick_params(axis='y', which='minor', length=3, width=2, labelsize=20, pad=8)
this_ylim = [0, 800]
ax.set_ylim(this_ylim)
#ax.set_xscale('log')
#ax.set_xlim(3680, 3780)
ax.set_title(r'[OII] EW Distribution', fontsize=20)
ax.set_xlabel(r'$W_{\rm O\,II}^{\lambda3728}$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'$\Delta N (\Delta W_{\rm O\,II}^{\lambda3728} = 5\, {\rm \AA}))$', fontsize=20)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/EW_distribution.eps')

# Luminosity
fig = plt.figure(figsize=(9,7))
ax = fig.add_subplot(111)
n, bins, patches = ax.hist(np.log10(vac_objs['OIILUM'][inuv]), 
                           bins=np.arange(40., 43.5, 0.1), edgecolor='black')
ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=22, pad=8)
ax.tick_params(axis='x', which='minor', length=4, width=2, labelsize=22, pad=8)
ax.tick_params(axis='y', which='major', length=6, width=2, labelsize=20, pad=8)
ax.tick_params(axis='y', which='minor', length=3, width=2, labelsize=20, pad=8)
    
this_ylim = [0, 1100]
ax.set_ylim(this_ylim)
#ax.set_xscale('log')
#ax.set_xlim(3680, 3780)
ax.set_title(r'[OII] Luminosity Distribution', fontsize=22)
ax.set_xlabel(r'$\log_{10}\,L_{\rm O\,II}^{\lambda3728}$ [${\rm erg\,s}^{-1}$]', fontsize=22)
ax.set_ylabel(r'$\Delta N (\Delta \log_{10}\,L_{\rm O\,II}^{\lambda3728} = 0.1\, {\rm dex})$', fontsize=22)
fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/Lum_distribution.eps')



In [74]:
print(np.median(np.log10(vac_objs['OIILUM'][inuv])))
print(np.median((vac_objs['OIIEW'][inuv])))


41.618402037
51.3733821572

In [79]:
tmp_vac_objs = ebossspec.elg_readin(vac=True)

In [80]:
print(np.median(np.log10(tmp_vac_objs['OIIILUM'][inuv])))
print(np.median((tmp_vac_objs['OIIIEW'][inuv])))
print(np.median(np.log10(tmp_vac_objs['HBETALUM'][inuv])))
print(np.median((tmp_vac_objs['HBETAEW'][inuv])))


41.6157151479
36.0226708138
41.5014429155
29.163527693

In [78]:
tmp_vac_objs.dtype


Out[78]:
dtype([('Z', '>f4', (21528,)), ('OIILUM', '>f8', (21528,)), ('OIIEW', '>f8', (21528,))])

In [81]:
fig = plt.figure(figsize=(9,7))
ax = fig.add_subplot(111)
n, bins, patches = ax.hist(tmp_vac_objs['OIIIEW'][inuv]/tmp_vac_objs['HBETAEW'][inuv], 
                           bins=np.arange(0, 10, 0.1), edgecolor='black')
ax.tick_params(axis='x', which='major', length=8, width=2, labelsize=22, pad=8)
ax.tick_params(axis='x', which='minor', length=4, width=2, labelsize=22, pad=8)
ax.tick_params(axis='y', which='major', length=6, width=2, labelsize=20, pad=8)
ax.tick_params(axis='y', which='minor', length=3, width=2, labelsize=20, pad=8)
this_ylim = [0, 800]
ax.set_ylim(this_ylim)
#ax.set_xscale('log')
#ax.set_xlim(3680, 3780)
ax.set_title(r'[OII] EW Distribution', fontsize=20)
ax.set_xlabel(r'$W_{\rm O\,II}^{\lambda3728}$ [$\AA$]', fontsize=20)
ax.set_ylabel(r'$\Delta N (\Delta W_{\rm O\,II}^{\lambda3728} = 5\, {\rm \AA}))$', fontsize=20)
#fig.savefig('/Users/Benjamin/Dropbox/Zhu_Projects/Fine Structure Emission/Version 1/EW_distribution.eps')


Out[81]:
<matplotlib.text.Text at 0x113cac650>

In [86]:
(inuv[(tmp_vac_objs['OIIILUM'][inuv]/tmp_vac_objs['HBETALUM'][inuv])<3.]).shape


Out[86]:
(7629,)

In [83]:
inuv.shape


Out[83]:
(8620,)

In [87]:
7629.+867.


Out[87]:
8496.0

In [88]:
870./8500.


Out[88]:
0.10235294117647059

In [ ]: